<template>
  <a-modal
    title="查看"
    :width="1000"
    :visible="visible"
    @cancel="() => { visible = false }"
  >
    <template slot="footer">
      <a-button type="primary" @click="visible = false">
        关闭
      </a-button>
    </template>
    <a-form v-bind="formLayout">
      <a-row class="form-row" :gutter="16">
        <a-col :lg="12" :md="24">
          <a-form-item label="标题">
            {{ model.title }}
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="24">
          <a-form-item label="发布日期">
            {{ model.pushDate }}
          </a-form-item>
        </a-col>
      </a-row>
      <a-row class="form-row" :gutter="16">
        <a-col :lg="12" :md="24">
          <a-form-item label="附件">
            <div :key="item.id" v-for="item in model.notificationFileList">
              <!-- <a :href="item.url" target="_black" :download="item.original">{{ item.original }}</a> -->
              <a @click="$fileDownLoad(item)">{{ item.original }}</a>
            </div>
          </a-form-item>
        </a-col>
        <a-col :lg="12" :md="24">
          <a-form-item label="详情">
            <!-- <a :href="model.detail?.url" target="_black" :download="model.detail?.original">{{ model.detail?.original }}</a> -->
            <a @click="$fileDownLoad(model.detail)" v-if="model.detail">{{ model.detail.original }}</a>
          </a-form-item>
        </a-col>
      </a-row>
    </a-form>
  </a-modal>
</template>

<script>
export default {
  components: {
   },
  props: {
  },
  data () {
    this.formLayout = {
      labelCol: {
        xs: { span: 24 },
        sm: { span: 7 }
      },
      wrapperCol: {
        xs: { span: 24 },
        sm: { span: 13 }
      }
    }
    return {
      visible: false,
      model: {}
    }
  },
  created () {
  },
  filters: {
    typeFilter (type) {
      const typeMap = {
        1: '通知通告',
        2: '材料示范',
        3: '评审结果'
      }
      return typeMap[type]
    }
  },
  methods: {
    checkView (record) {
      this.visible = true
      this.model = record
    }
  }
}
</script>
<style lang="less" scoped>
.reportImg {
  display: block;
  height: 100px;
}
</style>
